
namespace ShoppingCart.Business.Logic
{
	using System;
	using System.Collections.Generic;
	using ShoppingCart.Business.Entity;
	using ShoppingCart.DataAccess;

	/// <summary>
	/// Represents the Manager of Linea.
	/// </summary>
	[Serializable]
	public class LineaManager : Singleton<LineaManager>
	{
		#region Methods

		/// <summary>
		/// Selects all records from the Linea table.
		/// </summary>
		public IList<Linea> Listar()
		{
			try
			{
				return LineaData.Instancia.Listar();
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Selects a single record from the Linea table.
		/// </summary>
		public Linea Obtener(int idLinea)
		{
			try
			{
				return LineaData.Instancia.Obtener(idLinea);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Saves a record to the Linea table.
		/// </summary>
		public int Agregar(Linea linea)
		{
			try
			{
				return LineaData.Instancia.Agregar(linea);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Updates a record in the Linea table.
		/// </summary>
		public bool Modificar(Linea linea)
		{
			try
			{
				return LineaData.Instancia.Modificar(linea);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Deletes a record from the Linea table by its primary key.
		/// </summary>
		public bool Eliminar(int idLinea)
		{
			try
			{
				return LineaData.Instancia.Eliminar(idLinea);
			}
			catch (Exception) { throw; }
		}

		#endregion
	}
}
